<template>
	<view class="dial-container">
		<section><dialWrap ref="dialWrap" @openModelActive="openModelActive" :stateData="stateData" @openModelPrise="openModelPrise"></dialWrap></section>
		<model-active :textmsg="textmsg" v-if="resultFlag" @closeActive="closeActive"></model-active>
		<model-prise @openModelPrise="openModelPrise" v-if="priseFlag" @confirmPrise="confirmPrise"></model-prise>
		<suspension></suspension>
	</view>
</template>

<script>
import dialWrap from '../../components/dial/dial.vue';
import modelActive from '@/components/model_active.vue';
import modelPrise from '@/components/model_prise.vue';
import suspension from '@/components/suspension.vue';

export default {
	data() {
		return {
			resultFlag: false,
			priseFlag:false,
			textmsg: {
				nick_name: '',
				atvarImage: '',
				difference:100
			},
			stateData: {
				coin: 10,
				welfareList: [{ date: '2022', res: '1元话费' }, { date: '2021', res: '3元话费' }]

				// prize_img: 'https://wanxian-test.oss-cn-shenzhen.aliyuncs.com/dial.png'
			}
		};
	},
	onLoad() {
		this.textmsg.nick_name = uni.getStorageSync('nickName');
		this.textmsg.atvarImage = uni.getStorageSync('avatarUrl');
	},
	methods: {
		confirmPrise(){
			this.priseFlag=false,
			this.$refs.dialWrap.run()
		},
		closeActive() {
			this.resultFlag = false;
		},
		openModelPrise(){
			this.priseFlag=true;
		},
		openModelActive(val) {
			// console.log(2568,val)
			this.textmsg.difference=val.toFixed(2);
			this.resultFlag = true;
		}
	},
	components: { dialWrap, modelActive,modelPrise,suspension}
};
</script>
<style lang="scss">
@import url('../../static/css/reset.css');
.dial-container {
	width: 100%;
	height: 1800rpx;
	background-size: cover;
	display: inline-block;
	background: url(https://wanxian-test.oss-cn-shenzhen.aliyuncs.com/home-bg1.png) no-repeat, rgb(255, 107, 5);
	section {
		text-align: center;
		justify-content: center;
		width: 6.7rem;
		height: 6.7rem;
		margin: 0 auto;
		margin-top: 2.28rem;
	}
}
</style>
